﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace Presentation
{
    public class NameSt : INotifyPropertyChanged
    {
        public string Name
        {
            get;
            set;
        }

        public double CountName
        {
            get;
            set;
        }

        public event PropertyChangedEventHandler PropertyChanged;

        protected void OnPropertyChanged(string info)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(info));
            }
        }

    }

    public class NamesList : ObservableCollection<NameSt>
    {
        public NamesList()
            : base()
        {
            Add(new NameSt() { Name="Александр", CountName=34});
            Add(new NameSt() { Name = "Андрей", CountName =35  });
            Add(new NameSt() { Name = "Мария", CountName = 33 });
            Add(new NameSt() { Name = "Юлия", CountName = 25 });
            Add(new NameSt() { Name = "Анюта", CountName = 12 });
            Add(new NameSt() { Name = "Ира", CountName = 13 });

        }
    }
}
